@extends('back.adminbase')
@section('content')
    <section class="hbox stretch">
        @include("back.public.left")
        <aside>
            <section class="vbox">
                <header class="header bg-white b-b clearfix">
                    <form class="talbe-search" method="get" action="{{url('admin/function')}}">
                        <div class="row m-t-sm">
                            <div class="col-sm-9 m-b-xs">
                                {{--<a role="button" class="btn btn-sm btn-primary" href="{{url("admin/functionDetail/create/".$id)}}">添加二级规则--}}
                                    {{--<i class="glyphicon glyphicon-plus"></i>--}}
                                {{--</a>--}}
                            </div>
                        </div>
                    </form>
                </header>
                <section class="scrollable  wrapper w-f">
                    <section class="panel panel-default">
                        <div class="table-responsive">
                            <table class="table table-hover m-b-none entity-view" data-path="/attendance/count/countDetail/id/{0}">
                                <thead>
                                <tr>
                                    <th style="text-align: center;">序号</th>
                                    <th style="text-align: center;">书名</th>
                                    <th style="text-align: center;">作者</th>
                                    <th style="text-align: center;">页数</th>
                                    <th style="text-align: center;">出版社</th>
                                    <th style="text-align: center;">类型</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach ($res as $k=>$v)
                                    <tr>
                                        <td style="text-align: center;">{{$limit*($res->currentPage()-1)+$k+1}}</td>
                                        <td style="text-align: center;">{{$v->Title}}</td>
                                        <td style="text-align: center;">{{$v->Author}}</td>
                                        <td style="text-align: center;">{{$v->Pages}}</td>
                                        <td style="text-align: center;">{{$v->Publisher}}</td>
                                        <td style="text-align: center">
                                            {{\App\Util\memberBook::getLabel($v->status)}}
                                        </td>
                                    </tr>
                                @endforeach
                                </tbody>
                            </table>
                        </div>
                    </section>
                    <div style="text-align: center">{!! $res->appends($_GET)->render() !!}</div>
                </section>

            </section>
        </aside>
    </section>

@endsection

@section('addscript')
    <script>
        $(function(){
            $(".del").click(function(){
                var url=$(this).attr("data-back");

                layer.confirm('您确定删除吗？', {
                    btn: ['确认','取消'] //按钮
                }, function(){
                    $.ajax({
                        'url':url,
                        'type':"get",
                        'dataType':'json',
                        'success':function(data){
                            if(data.success){
                                layer.alert("删除成功！",function(){
                                    location.reload();
                                });
                            }else{
                                layer.alert(data.msg)
                            }
                        }
                    })
                }, function(){

                })
            })
        });
    </script>
@endsection
